/*
 * @Author: 0x9DEFA478
 * @Date: 2021-08-08 16:39:20
 * @LastEditTime: 2021-09-17 19:30:29
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#ifndef __H_USB_Desc_H_
#define __H_USB_Desc_H_


#define  vH_USB_DescType_Device                                   0x01U
#define  vH_USB_DescType_Configuration                            0x02U
#define  vH_USB_DescType_String                                   0x03U
#define  vH_USB_DescType_Interface                                0x04U
#define  vH_USB_DescType_Endpoint                                 0x05U
#define  vH_USB_DescType_DeviceQualifier                          0x06U
#define  vH_USB_DescType_OtherSpeedConfiguration                  0x07U
#define  vH_USB_DescType_InterfaceAssociation                     0x0BU
#define  vH_USB_DescType_BOS                                      0x0FU
#define  vH_USB_DescType_ClassSpecificInterface                   0x24U
#define  vH_USB_DescType_ClassSpecificEndpoint                    0x25U



#define cLittleTo2Bytes(value)                                    ((value)&0xFFU),(((value)>>8)&0xFFU)
#define cLittleTo3Bytes(value)                                    ((value)&0xFFU),(((value)>>8)&0xFFU),(((value)>>16)&0xFFU)
#define cLittleTo4Bytes(value)                                    ((value)&0xFFU),(((value)>>8)&0xFFU),(((value)>>16)&0xFFU),(((value)>>24)&0xFFU)


//============================================================================================================================================
//Audio 
//============================================================================================================================================

#define vH_USBAudioClass_V0100                                     0x0100U
#define vH_USBAudioClass_V0200                                     0x0200U

//UAC1.0

#define vH_USB_InterfaceClass_Audio_0100                           0x01U
#define vH_USB_InterfaceSubClass_AudioControl_0100                 0x01U
#define vH_USB_InterfaceSubClass_AudioStreaming_0100               0x02U

#define vH_USB_DescType_ACSubType_Header_0100                      0x01U
#define vH_USB_DescType_ACSubType_InputTerminal_0100               0x02U
#define vH_USB_DescType_ACSubType_OutputTerminal_0100              0x03U
#define vH_USB_DescType_ACSubType_MixerUnit_0100                   0x04U
#define vH_USB_DescType_ACSubType_SelectorUnit_0100                0x05U
#define vH_USB_DescType_ACSubType_FeatureUnit_0100                 0x06U
#define vH_USB_DescType_ACSubType_ProcessingUnit_0100              0x07U
#define vH_USB_DescType_ACSubType_ExtensionUnit_0100               0x08U

#define vH_USB_DescType_ASSubType_ASGeneral_0100                   0x01U
#define vH_USB_DescType_ASSubType_FormatType_0100                  0x02U
#define vH_USB_DescType_ASSubType_FormatSpecific_0100              0x03U

#define vH_USB_AudioRequest_Undefined_0100                         0x00U
#define vH_USB_AudioRequest_SetCur_0100                            0x01U
#define vH_USB_AudioRequest_GetCur_0100                            0x81U
#define vH_USB_AudioRequest_SetMin_0100                            0x02U
#define vH_USB_AudioRequest_GetMin_0100                            0x82U
#define vH_USB_AudioRequest_SetMax_0100                            0x03U
#define vH_USB_AudioRequest_GetMax_0100                            0x83U
#define vH_USB_AudioRequest_SetRes_0100                            0x04U
#define vH_USB_AudioRequest_GetRes_0100                            0x84U
#define vH_USB_AudioRequest_SetMem_0100                            0x05U
#define vH_USB_AudioRequest_GetMem_0100                            0x85U
#define vH_USB_AudioRequest_GetStat_0100                           0xFFU

#define vH_USB_AudioCS_Terminal_CopyProtectCtrl_0100               0x01U

#define vH_USB_AudioCS_FeatureUnit_MuteCtrl_0100                   0x01U
#define vH_USB_AudioCS_FeatureUnit_VolumeCtrl_0100                 0x02U
#define vH_USB_AudioCS_FeatureUnit_BassCtrl_0100                   0x03U
#define vH_USB_AudioCS_FeatureUnit_MidCtrl_0100                    0x04U
#define vH_USB_AudioCS_FeatureUnit_TrebleCtrl_0100                 0x05U
#define vH_USB_AudioCS_FeatureUnit_GraphicEqualizerCtrl_0100       0x06U
#define vH_USB_AudioCS_FeatureUnit_AutomaticGainCtrl_0100          0x07U
#define vH_USB_AudioCS_FeatureUnit_DelayCtrl_0100                  0x08U
#define vH_USB_AudioCS_FeatureUnit_BassBoostCtrl_0100              0x09U
#define vH_USB_AudioCS_FeatureUnit_LoudnessCtrl_0100               0x0AU

#define vH_USB_AudioCS_Endpoint_SamplingFrequencyCtrl_0100         0x01U
#define vH_USB_AudioCS_Endpoint_PitchCtrl_0100                     0x02U

//UAC2.0

#define vH_USB_InterfaceClass_Audio_0200                           0x01U
#define vH_USB_InterfaceSubClass_AudioControl_0200                 0x01U
#define vH_USB_InterfaceSubClass_AudioStreaming_0200               0x02U
#define vH_USB_InterfaceSubClass_AudioMIDIStreaming_0200           0x03U

#define vH_USB_DescType_ACSubType_Header_0200                      0x01U
#define vH_USB_DescType_ACSubType_InputTerminal_0200               0x02U
#define vH_USB_DescType_ACSubType_OutputTerminal_0200              0x03U
#define vH_USB_DescType_ACSubType_MixerUnit_0200                   0x04U
#define vH_USB_DescType_ACSubType_SelectorUnit_0200                0x05U
#define vH_USB_DescType_ACSubType_FeatureUnit_0200                 0x06U
#define vH_USB_DescType_ACSubType_EffectUnit_0200                  0x07U
#define vH_USB_DescType_ACSubType_ProcessingUnit_0200              0x08U
#define vH_USB_DescType_ACSubType_ExtensionUnit_0200               0x09U
#define vH_USB_DescType_ACSubType_ClockSource_0200                 0x0AU
#define vH_USB_DescType_ACSubType_ClockSelect_0200                 0x0BU
#define vH_USB_DescType_ACSubType_ClockMultiplier_0200             0x0CU
#define vH_USB_DescType_ACSubType_SampleReteConverter_0200         0x0DU

#define vH_USB_DescType_ASSubType_ASGeneral_0200                   0x01U
#define vH_USB_DescType_ASSubType_FormatType_0200                  0x02U
#define vH_USB_DescType_ASSubType_Encoder_0200                     0x03U
#define vH_USB_DescType_ASSubType_Decoder_0200                     0x04U

#define vH_USB_AudioRequest_Undefined_0200                         0x00U
#define vH_USB_AudioRequest_Cur_0200                               0x01U
#define vH_USB_AudioRequest_Range_0200                             0x02U
#define vH_USB_AudioRequest_Mem_0200                               0x03U

#define vH_USB_AudioCS_Terminal_CopyProtectCtrl_0200               0x01U
#define vH_USB_AudioCS_Terminal_ConnectorCtrl_0200                 0x02U
#define vH_USB_AudioCS_Terminal_OverloadCtrl_0200                  0x03U
#define vH_USB_AudioCS_Terminal_ClusterCtrl_0200                   0x04U
#define vH_USB_AudioCS_Terminal_UnderflowCtrl_0200                 0x05U
#define vH_USB_AudioCS_Terminal_OverflowCtrl_0200                  0x06U
#define vH_USB_AudioCS_Terminal_LatencyCtrl_0200                   0x07U

#define vH_USB_AudioCS_FeatureUnit_MuteCtrl_0200                   0x01U
#define vH_USB_AudioCS_FeatureUnit_VolumeCtrl_0200                 0x02U
#define vH_USB_AudioCS_FeatureUnit_BassCtrl_0200                   0x03U
#define vH_USB_AudioCS_FeatureUnit_MidCtrl_0200                    0x04U
#define vH_USB_AudioCS_FeatureUnit_TrebleCtrl_0200                 0x05U
#define vH_USB_AudioCS_FeatureUnit_GraphicEqualizerCtrl_0200       0x06U
#define vH_USB_AudioCS_FeatureUnit_AutomaticGainCtrl_0200          0x07U
#define vH_USB_AudioCS_FeatureUnit_DelayCtrl_0200                  0x08U
#define vH_USB_AudioCS_FeatureUnit_BassBoostCtrl_0200              0x09U
#define vH_USB_AudioCS_FeatureUnit_LoudnessCtrl_0200               0x0AU
#define vH_USB_AudioCS_FeatureUnit_InputGainCtrl_0200              0x0BU
#define vH_USB_AudioCS_FeatureUnit_InputGainPadCtrl_0200           0x0CU
#define vH_USB_AudioCS_FeatureUnit_PhaseInverterCtrl_0200          0x0DU
#define vH_USB_AudioCS_FeatureUnit_UnderflowCtrl_0200              0x0EU
#define vH_USB_AudioCS_FeatureUnit_OverflowCtrl_0200               0x0FU
#define vH_USB_AudioCS_FeatureUnit_LatencyCtrl_0200                0x10U

#define vH_USB_AudioCS_ClockSource_SampleFrequencyCtrl_0200        0x01U
#define vH_USB_AudioCS_ClockSource_ClockValidCtrl_0200             0x02U

#define vH_USB_AudioCS_Endpoint_PitchCtrl_0200                     0x01U
#define vH_USB_AudioCS_Endpoint_DataOverrunCtrl_0200               0x02U
#define vH_USB_AudioCS_Endpoint_DataUnderrunCtrl_0200              0x03U


//============================================================================================================================================
//HID
//============================================================================================================================================

#define cHID_ReportMainItem_Input(Size)                            (0x80U|(Size&0x03U))
#define cHID_ReportMainItem_Output(Size)                           (0x90U|(Size&0x03U))
#define cHID_ReportMainItem_Feature(Size)                          (0xB0U|(Size&0x03U))
#define cHID_ReportMainItem_Collection(Size)                       (0xA0U|(Size&0x03U))
#define cHID_ReportMainItem_EndCollection(Size)                    (0xC0U|(Size&0x03U))

#define cHID_ReportGlobalItem_UsagePage(Size)                      (0x04U|(Size&0x03U))
#define cHID_ReportGlobalItem_LogicalMinimum(Size)                 (0x14U|(Size&0x03U))
#define cHID_ReportGlobalItem_LogicalMaximum(Size)                 (0x24U|(Size&0x03U))
#define cHID_ReportGlobalItem_PhysicalMinimum(Size)                (0x34U|(Size&0x03U))
#define cHID_ReportGlobalItem_PhysicalMaximum(Size)                (0x44U|(Size&0x03U))
#define cHID_ReportGlobalItem_UnitExponent(Size)                   (0x54U|(Size&0x03U))
#define cHID_ReportGlobalItem_Unit(Size)                           (0x64U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportSize(Size)                     (0x74U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportID(Size)                       (0x84U|(Size&0x03U))
#define cHID_ReportGlobalItem_ReportCount(Size)                    (0x94U|(Size&0x03U))
#define cHID_ReportGlobalItem_Push(Size)                           (0xA4U|(Size&0x03U))
#define cHID_ReportGlobalItem_Pop(Size)                            (0xB4U|(Size&0x03U))

#define cHID_ReportLocalItem_Usage(Size)                           (0x08U|(Size&0x03U))
#define cHID_ReportLocalItem_UsageMinimum(Size)                    (0x18U|(Size&0x03U))
#define cHID_ReportLocalItem_UsageMaximum(Size)                    (0x28U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorIndex(Size)                 (0x38U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorMinimum(Size)               (0x48U|(Size&0x03U))
#define cHID_ReportLocalItem_DesignatorMaximum(Size)               (0x58U|(Size&0x03U))
#define cHID_ReportLocalItem_StringIndex(Size)                     (0x78U|(Size&0x03U))
#define cHID_ReportLocalItem_StringMinimum(Size)                   (0x88U|(Size&0x03U))
#define cHID_ReportLocalItem_StringMaximum(Size)                   (0x98U|(Size&0x03U))
#define cHID_ReportLocalItem_Delimiter(Size)                       (0xA8U|(Size&0x03U))

#define vHID_ReportItemValue_Collection_Physical                   0x00U
#define vHID_ReportItemValue_Collection_Application                0x01U
#define vHID_ReportItemValue_Collection_Logical                    0x02U
#define vHID_ReportItemValue_Collection_Report                     0x03U
#define vHID_ReportItemValue_Collection_NamedArray                 0x04U
#define vHID_ReportItemValue_Collection_UsageSwitch                0x05U
#define vHID_ReportItemValue_Collection_UsageModifier              0x06U

#define vH_USB_HIDRequest_GetReport                                0x01U
#define vH_USB_HIDRequest_GetIdle                                  0x02U
#define vH_USB_HIDRequest_GetProtocol                              0x03U
#define vH_USB_HIDRequest_SetReport                                0x09U
#define vH_USB_HIDRequest_SetIdle                                  0x0AU
#define vH_USB_HIDRequest_SetProtocol                              0x0BU


//============================================================================================================================================
//winusb
//============================================================================================================================================

#define MS_OS_20_SET_HEADER_DESCRIPTOR                             0x00U
#define MS_OS_20_SUBSET_HEADER_CONFIGURATION                       0x01U
#define MS_OS_20_SUBSET_HEADER_FUNCTION                            0x02U
#define MS_OS_20_FEATURE_COMPATIBLE_ID                             0x03U
#define MS_OS_20_FEATURE_REG_PROPERTY                              0x04U
#define MS_OS_20_FEATURE_MIN_RESUME_TIME                           0x05U
#define MS_OS_20_FEATURE_MODEL_ID                                  0x06U
#define MS_OS_20_FEATURE_CCGP_DEVICE                               0x07U
#define MS_OS_20_FEATURE_VENDOR_REVISION                           0x08U

#define MS_OS_20_REG_PROPERTY_PropertyDataType_RESERVED                 0x00U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_SZ                   0x01U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_EXPAND_SZ            0x02U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_BINARY               0x03U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_DWORD_LITTLE_ENDIAN  0x04U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_DWORD_BIG_ENDIAN     0x05U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_LINK                 0x06U
#define MS_OS_20_REG_PROPERTY_PropertyDataType_REG_MULTI_SZ             0x07U







#endif //__H_USB_Desc_H_
